   #!/usr/bin/perl -w
    use strict;

    my %hash = (
        a => {
            1 => "one",
            2 => "two",
            3 => "three",
        },
        b => {
            4 => "four",
            5 => "five",
            6 => "six",
        },
    );

    foreach my $line (keys %hash) {
        print "$line: \n";
        foreach my $elem (keys %{$hash{$line}}) {
            print "  $elem: " . $hash{$line}->{$elem} . "\n";
        }
    }

    exit 0;